package com.bw.liuyushan.mykotlin_firstmvptest.MVVM

import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory

/**
 *MyKotlin_FirstMVPTest
 *file name is : RetrofitManager
 *created by Ender on 2021/9/16 15:38.
 *author : 刘雨杉
 *Describe:练习的MVVM框架半成品
 */


object RetrofitManager {

    const val BASE_URL ="http://www.qubaobei.com/"

    fun getRetrofit() = Retrofit.Builder()
        .baseUrl(BASE_URL)
        .client(OkHttpClient().newBuilder()
            .addInterceptor(HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)).build())
        .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
        .addConverterFactory(GsonConverterFactory.create())
        .build()


}